package test;

import java.io.File;

public class Structure {
	public String getDirectory(String path){
		int lastSlashIndex = path.lastIndexOf("/");
		return path.substring(0, lastSlashIndex);
	}
	
	public static void main(String args[]) throws Exception{
		
		String p = "http://www.free-celeb-movie-archive.com/scarlett-johansson/photos";
		File d = new File(p);
		File files[] = d.listFiles();
		
		for(int i=0; i<files.length; i++){
			System.out.println(files[i].getAbsolutePath());
		}
		
//		String path ="/Users/yannis/flip.txt"; 
//		File file = new File(path);
//		
//		Structure s = new Structure();
//		String dirPath = s.getDirectory(path);
//		
//		File dir = new File(dirPath);
//		if(!dir.exists()){
//			System.out.println("create dir: " + dirPath);
//			dir.mkdirs();
//		}
//		file.createNewFile();
//		(new File("/Users/yannis/hab/abc/test/http/flip.txt")).createNewFile();
		
	}
}
